<div style="float:right;">
	<?php echo $this->Html->link('New Category', array('action' => 'add', 'admin' => true), array('class' => 'btn btn-primary'))?>
</div>
<table class="table table-striped">
	<thead>
		<tr>
			<th><?php echo $this->Paginator->sort(__('#'), 'id')?></th>
			<th><?php echo $this->Paginator->sort(__('Title'), 'title')?></th>
			<th><?php echo $this->Paginator->sort(__('Parent'), 'parent_id');?></th>
			<th><?php echo $this->Paginator->sort(__('Description'), 'description');?></th>
			<th><?php echo $this->Paginator->sort(__('Created'), 'created')?></th>
			<th><?php echo $this->Paginator->sort(__('Updated'), 'updated')?></th>
			<th>Others</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($categories as $category):?>
			<tr>
				<td><?php echo $category['Category']['id']?></td>
				<td><?php echo $category['Category']['title']?></td>
				<td><?php echo empty($category['Category']['parent_id']) ? '<font color="#B94A48">'.__('None').'</font>' : $categories[$category['Category']['parent_id']]['Category']['title']?></td>
				<td style="max-width: 350px"><?php echo $category['Category']['description']?></td>
				<td><?php echo $category['Category']['created']?></td>
				<td><?php echo $category['Category']['updated']?></td>
				<td>
					<?php 
						echo $this->Html->link('Delete', 
							array('action' => 'delete', 'admin' => true, $category['Category']['id']), 
							array('class' => 'btn'))
					?>
					&nbsp;
					<?php 
						echo $this->Html->link('Edit', 
							array('action' => 'edit', 'admin' => true, $category['Category']['id']), 
							array('class' => 'btn'))
					?>
				</td>
			</tr>
		<?php endforeach;?>
	</tbody>
</table>
<p>
	<?php
		echo $this->Paginator->counter(array(
			'format' => 'Page %page% of %pages%, showing %current% records out of %count% total.'
		)); 
	?>	
</p>
<?php if ($this->params['paging']['Category']['pageCount'] > 1):?>
	<div class="btn-group">
		<span class="btn"><?php echo $this->Paginator->prev(__('previous '), array(), null);?></span>
		<span class="btn"><?php echo $this->Paginator->numbers(array('separator' => '-'));?></span>
		<span class="btn"><?php echo $this->Paginator->next(__(' next'), array(), null); ?></span>
	</div>
<?php endif;?>
